<template>
    <view clas="smart-page">
        <view class="smrat-page-head">
            <view class="smsrt-page-head-title">audio</view>
        </view>
        <view>
            <button type="primary" @click="play()">播放</button>
            <audio id="myaudio" name="我爱中国" controls="true" poster="../../../static/logo.png"
            author="贝多芬" src="../../../static/audio/music.mp3"></audio>
        </view>
    </view>
</template>
<script>
export default {
    data(){
        return{

        }
    },
    onRweady(){
        this.audioContext = uni.createAuContext('myaudio')
    },
    methods:{
        play(){
            this.audioContext.play()
        }
        pause(){
            this.audioContext.pause()
        }
    }
}
</script>